/**
 * Created by mahai on 2018/12/21.
 */


const mongoose = require('mongoose');
const Schema = mongoose.Schema;

//创建 Schema
 const UserSchema = new Schema({
     lastName:{
         type:String
     },
     firstName:{
         type:String
     },
     username:{
         type:String,
         required:true
     },
     email:{
         type:String,
         default:''
     },
     password:{
         type:String,
         required:true
     },
     avatar:{
         type:String
     },
     date:{
         type:Date,
         default:Date.now()
     },
     role:{
         type:Array,
         default:[]
     }
 });

module.exports = User = mongoose.model('users',UserSchema);
